#!/usr/bin/env bash

PREFIX=$(cd "$(dirname "$0")"; pwd)
cd $PREFIX
source config.sh

function dump {
mkdir -p table/$PSQL_DB
FILE=table/$PSQL_DB/$1.sql
echo $FILE
pg_dump $PSQL_URL --no-owner --no-acl -s -n $1 -f $FILE
sed  -i '/^-- .* version .*/d' $FILE
}



for i in "${TABLE_LI[@]}"
do
   dump $i
done
